package com.ys.controller.api.sys;

import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bo.vo.R;
import com.ys.entity.sys.TbStaticConfig;
import com.ys.service.sys.CommonApiService;
import com.ys.service.sys.TbStaticConfigService;
import com.ys.vo.LayuiTableVoJA;

@Controller
@RequestMapping("/api/inter/tbStaticConfig")
public class ApiInterTbStaticConfigController {
	
//	private static final Logger logger = Logger.getLogger(ApiAdminLoginController.class);
	
	@Autowired
	private CommonApiService<TbStaticConfig> commonApiService;
	@Autowired
	private TbStaticConfigService tbStaticConfigService;

	@RequiresPermissions("tbStaticConfig:view")
	@RequestMapping("/search")
    @ResponseBody
	public LayuiTableVoJA search(@ModelAttribute TbStaticConfig cond){
		
		
		return commonApiService.searchLay(cond);
	}
	
	/**
	 * 修改
	 */
	@RequiresPermissions("tbStaticConfig:edit")
	@PostMapping("/edit")
    @ResponseBody
	public R edit(@RequestParam Map<String, Object> params){
		try {
			return tbStaticConfigService.edit(params);
		} catch (Exception e) {
			e.printStackTrace();
			return R.error("系统正在开小差，请联系客服，我们将第一时间为您解决！");
		}

	}
}
